home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1996 May: Tool Chest / Developer CD Series May 1996 (Tool Chest) (Apple Computer) (1996).iso / Tool Chest / Developer Utilities / Installer 4.0.3 SDK / Script Examples / File Compression Example / Makefile < prev    next >
Encoding:
Makefile  |  1994-11-15  |  5.4 KB  |  137 lines  |  [TEXT/MPS ]

  1. #
  2. #    makefile for "fileCompress.r", the example for InstaCompOne file compression
  3. #
  4. #
  5. #        to build installer script :
  6. #            1) select "Build" from "Build" menu
  7. #            2) type script name "fileCompress" ( note: ".r" is omitted )
  8. #            
  9. #        to build debug version of installer script :
  10. #            1) select "Build" from "Build" menu
  11. #            2) type script name "fileCompress.debug" ( note: ".r" is omitted )
  12. #            
  13. #
  14. #    mark young - 08/17/94
  15. #
  16.  
  17. # • script names
  18.  
  19. # the installer script name
  20. scriptName                = fileCompress
  21. # the debug version installer script name
  22. debugScriptName            = {scriptName}.debug
  23. # filename for ScriptCheck extension that will run when ScriptCheck does
  24. localScriptCheckExtName    = {scriptName}.scx
  25.  
  26. # • tool names
  27.  
  28. # • support directory names
  29.  
  30. # directory where ScriptCheck MPW tool can be found
  31. ScriptCheckDir            = :::ScriptCheck 4.0.3:
  32. # directory where RIncludes can be found
  33. InstallerRIncDir        = :::DeveloperInterfaces:RIncludes:
  34. # directory where the Installer Debugger can be found
  35. InstallerDebuggerDir    = :::Installer Debugger 4.0:
  36. # directory where the InstaCompOne stuff can be found
  37. InstaCompOneDir            = :::InstaCompOne 1.0:
  38.  
  39.  
  40. # InstaCompOne compression tool
  41. compressTool            = {InstaCompOneDir}InstaCompOneTool
  42.  
  43. # Splitting tool
  44. splitTool                = {InstaCompOneDir}FileAndRsrcSplitterTool
  45.  
  46. # Original ScriptCheck Extension
  47. ScriptCheckExtension    = {InstaCompOneDir}InstaCompOneSCExt.rsrc
  48.  
  49.  
  50. # • simple compression example
  51.  
  52. # source file to be compressed
  53. SimpleSourceFileName    = TeachText • 1
  54. # archive file to be compressed into
  55. SimpleArchiveName        = :Disk 1:Tome
  56.  
  57. # • split compression example
  58.  
  59. # source file to be split and compressed
  60. SplitCompSourceFileName        = TeachText • 2
  61. # base name to use for files resulting from splitting operation 
  62. SplitCompFileName            = splitCompTeachText
  63. # first interim file resulting from splitting operation
  64. SplitCompFileName1            = splitCompTeachText.rsrc1
  65. # second interim file resulting from splitting operation
  66. SplitCompFileName2            = splitCompTeachText.rsrc2
  67. # archive resulting from compression of first interim file
  68. SplitCompArchiveName1        = :Disk 1:splitCompTome1
  69. # archive resulting from compression of second interim file
  70. SplitCompArchiveName2        = :Disk 2:splitCompTome2
  71.  
  72. # • split w/o compression example
  73.  
  74. # source file to be split, but not compressed
  75. SplitSourceFileName            = TeachText • 3
  76. # base name to use for files resulting from splitting operation 
  77. SplitFileName                = splitTeachText
  78. # first interim file resulting from splitting operation
  79. SplitFileName1                = splitTeachText.rsrc1
  80. # second interim file resulting from splitting operation
  81. SplitFileName2                = splitTeachText.rsrc2
  82. # first archive resulting from splitting of file
  83. SplitArchiveName1            = :Disk 1:splitTome1
  84. # second archive resulting from splitting of file
  85. SplitArchiveName2            = :Disk 2:splitTome2
  86.  
  87.  
  88.  
  89. # make the debug version of finished installer script
  90. "{debugScriptName}" ƒ "{scriptName}"
  91.     # make a copy of the finished installer script and rename the copy
  92.     Duplicate -y "{scriptName}" "{scriptName} w/ Debugger"
  93.     # add the installer debugger resources to the copied installer script
  94.     Rez -m "{InstallerDebuggerDir}Installer Debugger.r" -append -o "{scriptName} w/ Debugger"
  95.  
  96. # make the standard version of finished installer script
  97. "{scriptName}" ƒ makefile "{scriptName}.r" "{SimpleArchiveName}" "{SplitCompArchiveName1}" "{SplitArchiveName1}" "{localScriptCheckExtName}"
  98.     # establish current date with time of NOON
  99.     set theTime    "'`date -d -s` 12:00:00 PM'"
  100.     # rez the installer source into the form that the installer can read
  101.     Rez "{scriptName}.r" -o "{scriptName}" -t 'kajr' -c 'kajr' -i "{InstallerRIncDir}" 
  102.     # establish filename for finished installer script, set creation date and time, set attributes
  103.     SetFile -a b -d {theTime} "{scriptName}"
  104.     # run scriptcheck utility on the rezzed installer script
  105.     "{ScriptCheckDir}ScriptCheck" "{scriptName}" -h -d -a
  106.     # set modification date and time for finished installer script
  107.     SetFile -m {theTime} "{scriptName}"
  108.  
  109. # be sure that's there's a copy of the InstaCompOne ScriptCheck extension in current folder
  110. "{localScriptCheckExtName}" ƒ "{ScriptCheckExtension}"
  111.     # copy and rename the original scriptcheck extension
  112.     Duplicate -y "{ScriptCheckExtension}" "{localScriptCheckExtName}"
  113.  
  114. # do the simple compression
  115. "{SimpleArchiveName}" ƒ makefile "{SimpleSourceFileName}"
  116.     # compress entire source file into one archive
  117.     "{compressTool}" "{SimpleSourceFileName}" -o "{SimpleArchiveName}"
  118.  
  119. # do the split compression
  120. "{SplitCompArchiveName1}" ƒ makefile "{SplitCompSourceFileName}"
  121.     # split source file into parts no larger than 20K - place in two interim files
  122.     "{splitTool}" "{SplitCompSourceFileName}" -s 20000 -o "{SplitCompFileName}"
  123.     # compress contents of first interim file into first archive
  124.     "{compressTool}" "{SplitCompFileName1}" -o "{SplitCompArchiveName1}" -f "{SplitCompSourceFileName}" -e
  125.     # compress contents of second interim file into second archive
  126.     "{compressTool}" "{SplitCompFileName2}" -o "{SplitCompArchiveName2}" -f "{SplitCompSourceFileName}" -e
  127.  
  128. # do the split w/o compression
  129. "{SplitArchiveName1}" ƒ makefile "{SplitSourceFileName}"
  130.     # split source file into parts no larger than 20K - place in two interim files
  131.     "{splitTool}" "{SplitSourceFileName}" -s 20000 -o "{SplitFileName}"
  132.     # create archive with first part of split file by copying first interim file
  133.     Duplicate -y "{SplitFileName1}" "{SplitArchiveName1}"
  134.     # create archive with second part of split file by copying second interim file
  135.     Duplicate -y "{SplitFileName2}" "{SplitArchiveName2}"
  136.  
  137.